//
//  OMPCTableCell.m
//  OMENGO
//
//  Created by 梁尚嘉 on 2017/3/4.
//  Copyright © 2017年 Kamfat. All rights reserved.
//

#import "OMPCTableCell.h"

@implementation OMPCTableCell

- (void)configure
{
    [super configure];

    self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    self.backgroundColor = SM_whiteColor;
    self.contentView.backgroundColor = [UIColor clearColor];

    _iconImageView = [UIImageView new];
    [self.contentView addSubview:_iconImageView];
    [_iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(SM_SIZE(35)));
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.width.height.equalTo(@(SM_SIZE(55)));
    }];

    _elementLabel = [UILabel new];
    [self.contentView addSubview:_elementLabel];
    [_elementLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_iconImageView.mas_right).offset(SM_SIZE(25));
        make.centerY.equalTo(_iconImageView.mas_centerY);
    }];


    _descLabel = [UILabel new];
    [self.contentView addSubview:_descLabel];
    [_descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(@(SM_SIZE(-20)));
        make.centerY.equalTo(self.contentView.mas_centerY);
    }];

}

- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
{
    [super setHighlighted:highlighted animated:animated];
    if (self.canHighLight) {
        self.backgroundColor = highlighted ? HEXCOLOR(@"F6F6F6") : SM_whiteColor;
    }
}
@end
